package com.atguigu.gmall.activity.client;

import com.atguigu.gmall.activity.client.impl.SeckillGoodsFeignClientImpl;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.model.activity.SeckillGoods;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
import java.util.Map;

@FeignClient(value = "service-activity", path = "/api/activity/seckill", fallback = SeckillGoodsFeignClientImpl.class)
public interface SeckillGoodsFeignClient {

    @GetMapping("/get/all/sec/kill/goods")
    Result<List<SeckillGoods>> getAllSeckillGoods();

    @GetMapping("/get/sec/kill/goods/{skuId}")
    Result<SeckillGoods> getSecKillGoodsBySkuId(@PathVariable("skuId") Long skuId);

    @RequestMapping("/get/order/trade/data")
    Result<Map<String,Object>> getOrderTradeData();
}
